﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewAccount.aspx.cs" Inherits="FimetContoDeposito.Authentication.NewAccount" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <asp:PlaceHolder ID="PlaceHolder1" runat="server"> 
        <%: Scripts.Render("~/bundles/JQuery") %>          
        <%: Scripts.Render("~/bundles/JQueryUI") %>                
        <%: Styles.Render("~/bundles/Formly/css") %>
        <%: Scripts.Render("~/bundles/Formly") %>
    </asp:PlaceHolder>
          
    <script type="text/javascript" lang="javascript" src="../Scripts/Formly/FormlyHelper.js"></script>
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.Core.js"></script> 
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.AngularJS.Directives.Fileupload.js"></script> 
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.AngularJS.Directives.DateTimePicker.js"></script> 
    <script type="text/javascript" lang="javascript" src="../Scripts/GrayParrot.AngularJS.js"></script> 

    <style>
        body {
        margin: 20px
        }

        .formly-field {
        margin-bottom: 16px;
        }
    </style>

<!-- Meta information -->
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"/>
<!-- Title-->
<title>New Account</title>
<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png"/>
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png"/>
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png"/>
<link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png"/>
<link rel="shortcut icon" href="assets/ico/favicon.ico"/>
<!-- CSS Stylesheet-->
<link type="text/css" rel="stylesheet" href="/assets/css/bootstrap/bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="/assets/css/bootstrap/bootstrap-themes.css" />
<link type="text/css" rel="stylesheet" href="/assets/css/style.css" />

</head>
<body class="full-lg" ng-app="formlyExample" ng-controller="MainCtrl as vm" id="divFormly" name="divFormly">

<div id="main">
        <div id="md-messages" class="modal fade md-slideUp" tabindex="-1">
				<div class="modal-header bd-theme-inverse-darken">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
						<h4 class="modal-title"><i class="fa fa-inbox"></i> Inbox messages</h4>
				</div>
				<!-- //modal-header-->
				<div class="modal-body" style="padding:0">
				</div>
				<!-- //modal-body-->
		</div>

		<div class="container">
				<div class="row">
                    <div class="col-lg-3"></div>
						<div class="col-lg-6">

                            <div class="account-wall">
								<section class="align-lg-center">
										<div class="site-logo"></div>

    <h1>Nuovo Account<br /><hr /></h1>
    <div ng-if="vm.loadingData.$$state.status === 0" style="margin:20px 0;font-size:2em">
        <strong>Loading...</strong>
    </div>
    <div ng-if="vm.loadingData.$$status.state !== 0">
        <form ng-submit="vm.onSubmit()" novalidate id="formlyForm">
            <formly-form model="vm.model" fields="vm.fields" form="vm.form">
            <button type="sumbit" class="btn btn-primary submit-button" ng-disabled="vm.form.$invalid">Invia</button>
            </formly-form>
        </form>
    </div>

                                </section>
                              </div>
                       </div>
                    <div class="col-lg-3"></div>
                    </div>
                </div>
        </div>

<!--
////////////////////////////////////////////////////////////////////////
//////////     JAVASCRIPT  LIBRARY     //////////
/////////////////////////////////////////////////////////////////////
-->
		
<!-- Jquery Library -->
<script type="text/javascript" src="/assets/js/jquery.min.js"></script>
<script type="text/javascript" src="/assets/js/jquery.ui.min.js"></script>
<script type="text/javascript" src="/assets/plugins/bootstrap/bootstrap.min.js"></script>
<!-- Modernizr Library For HTML5 And CSS3 -->
<script type="text/javascript" src="/assets/js/modernizr/modernizr.js"></script>
<script type="text/javascript" src="/assets/plugins/mmenu/jquery.mmenu.js"></script>
<script type="text/javascript" src="/assets/js/styleswitch.js"></script>
<!-- Library 10+ Form plugins-->
<script type="text/javascript" src="/assets/plugins/form/form.js"></script>
<!-- Datetime plugins -->
<script type="text/javascript" src="/assets/plugins/datetime/datetime.js"></script>
<!-- Library Chart-->
<script type="text/javascript" src="/assets/plugins/chart/chart.js"></script>
<!-- Library  5+ plugins for bootstrap -->
<script type="text/javascript" src="/assets/plugins/pluginsForBS/pluginsForBS.js"></script>
<!-- Library 10+ miscellaneous plugins -->
<script type="text/javascript" src="/assets/plugins/miscellaneous/miscellaneous.js"></script>
<!-- Library Themes Customize-->
<script type="text/javascript" src="/assets/js/caplet.custom.js"></script>

<script type="text/javascript">

    var idToEdit = GetQueryStringParams("id");

    var settings = new FormlySettings();
    settings.container = '#divFormly';
    settings.callbackSuccess = SuccessCallback;

    settings.setLoad(settings.createGetConfig('/api/Customers/LoadFieldsNewCustomer'));
    settings.setSend(settings.createPostConfig('/api/Customers/NewUserCustomer'));

    FormlyManager(settings);

    //
    function SuccessCallback(response) {

        //ShowResponseMessage(response);
        $('.modal-title').text('Nuovo Utente');
        $('#md-messages .modal-body').html("<p><h3>&nbsp;&nbsp;" + response + "&nbsp;&nbsp;</h3><br/></p>");
        $('#md-messages').modal('show');
    }

</script>
</body>
</html>
